// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{c4c4e941-55ff-455a-88ca-d385695526c3}")]
	#endregion

	#region Documentation
	//1 Meldebogenspieler
	/// Spielerinformation, der auf einem Meldebogen 
	/// eingetragen wird
	#endregion

	#endregion
	public class Meldebogenspieler: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 9);
			public const int AufgestellerSpieler_MemberIndex = Eco_FirstMember + 0;
			public const int AufgestelltesDoppel2_MemberIndex = Eco_FirstMember + 1;
			public const int Aufstellung_MemberIndex = Eco_FirstMember + 2;
			public const int Ersatzmannschaft_MemberIndex = Eco_FirstMember + 3;
			public const int Leistungszahl_MemberIndex = Eco_FirstMember + 4;
			public const int Meldebogen_MemberIndex = Eco_FirstMember + 5;
			public const int Position_MemberIndex = Eco_FirstMember + 6;
			public const int PositionsBesonderheit_MemberIndex = Eco_FirstMember + 7;
			public const int Spielberechtigung_MemberIndex = Eco_FirstMember + 8;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Meldebogenspieler.Eco_LoopbackIndices.Ersatzmannschaft_MemberIndex), Id="{d25f67e0-e1e1-43dd-98f9-ab274ed301c4}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.Ersatzmannschaft), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Mannschaft Ersatzmannschaft
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Mannschaft) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Ersatzmannschaft_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Ersatzmannschaft_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Meldebogenspieler.Eco_LoopbackIndices.Leistungszahl_MemberIndex), Id="{025f33d9-d835-4929-9b8e-7dc473285bf8}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Leistungszahl des Spielers in der Halbrunde
		/// Leistungszahl des Spielers in der Halbrunde
		#endregion

		#endregion
		public decimal Leistungszahl
		{
			get
			{
				#region MM_ECO_Generated
				return (decimal) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Leistungszahl_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Leistungszahl_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Meldebogenspieler.Eco_LoopbackIndices.Meldebogen_MemberIndex), Id="{b2e92e19-13cf-4048-a4e0-29e333bfa869}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.MeldebogenspielerMeldebogen), Index=1)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Meldebogen Meldebogen
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Meldebogen) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Meldebogen_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Meldebogen_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Meldebogenspieler.Eco_LoopbackIndices.Position_MemberIndex), Id="{cb8080d6-aeef-4eaa-8749-65d00daff307}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.MeldebogenspielerPosition), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Position> Position
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Position>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Position_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Meldebogenspieler.Eco_LoopbackIndices.Spielberechtigung_MemberIndex), Id="{aba8c48e-39e5-4328-a5a3-6f9054c731d1}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SpielberechtigungMeldebogenspieler), Index=0)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Spielberechtigung Spielberechtigung
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Spielberechtigung) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Spielberechtigung_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Spielberechtigung_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Meldebogenspieler.Eco_LoopbackIndices.PositionsBesonderheit_MemberIndex), Id="{8d601060-fa29-4c7e-958b-9353a4ee11fd}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.PositionPositionsBesonderheit), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.PositionsBesonderheit PositionsBesonderheit
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.PositionsBesonderheit) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.PositionsBesonderheit_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.PositionsBesonderheit_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Meldebogenspieler.Eco_LoopbackIndices.Aufstellung_MemberIndex), Id="{77e4b677-11e4-4539-977d-ddf8b90ad103}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.Einzelposition), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Aufstellung> Aufstellung
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Aufstellung>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Aufstellung_MemberIndex)));
				#endregion
			}
		}


		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Meldebogenspieler.Eco_LoopbackIndices.AufgestellerSpieler_MemberIndex), Id="{3531473c-27b7-4472-ad08-a4ed269bb476}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.AufgestellerSpielerMeldebogenspieler), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<AufgestellerSpieler> AufgestellerSpieler
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<AufgestellerSpieler>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.AufgestellerSpieler_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Meldebogenspieler.Eco_LoopbackIndices.AufgestelltesDoppel2_MemberIndex), Id="{39e5c62e-4ff2-4fc5-9e4c-ae6c4e227b36}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.AufgestelltesDoppelMeldebogenspieler), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<AufgestelltesDoppel> AufgestelltesDoppel2
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<AufgestelltesDoppel>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.AufgestelltesDoppel2_MemberIndex)));
				#endregion
			}
		}

		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public Meldebogenspieler(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public Meldebogenspieler(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
